﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCQLSach.ascx.cs" Inherits="WebUserControl" %>
<%@ Import Namespace="SachOnlineLibrary.Public" %>

<style type="text/css">
    .auto-style1 {
        width: 1000px;
    }

    .auto-style4 {
        height: 26px;
    }
    .auto-style5 {
        height: 26px;
        width: 145px;
    }
    .auto-style6 {
        width: 145px;
    }
</style>

<div style="width: 1000px">
    <asp:Panel ID="themsuasach" runat="server" Width="100%" Visible="False">
        <table style="width:100%">
            <tr>
                <td colspan="2">
                    <asp:Label ID="lblTieude" runat="server"></asp:Label>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="auto-style5">
                    <asp:Label ID="lblHinh" runat="server" Text="Hình"></asp:Label>
                </td>
                <td class="auto-style4">
                    <asp:FileUpload ID="fuHinh" runat="server" Width="93px" />
                </td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:Label ID="lblTenSach" runat="server" Text="Tựa sách"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtTenSach" runat="server" Width="177px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:Label ID="lblLoai" runat="server" Text="Thể loại"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="ddlLoai" runat="server" Height="30px" Width="177px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:Label ID="lblGiaTien" runat="server" Text="Giá tiền"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtGiaTien" runat="server" Width="177px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:Label ID="lblSoLuong" runat="server" Text="Số lượng"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="ddlSoLuong" runat="server">
                        <asp:ListItem>0</asp:ListItem>
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                        <asp:ListItem>4</asp:ListItem>
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem>6</asp:ListItem>
                        <asp:ListItem>7</asp:ListItem>
                        <asp:ListItem>8</asp:ListItem>
                        <asp:ListItem>9</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>11</asp:ListItem>
                        <asp:ListItem>12</asp:ListItem>
                        <asp:ListItem>13</asp:ListItem>
                        <asp:ListItem>14</asp:ListItem>
                        <asp:ListItem>15</asp:ListItem>
                        <asp:ListItem>16</asp:ListItem>
                        <asp:ListItem>17</asp:ListItem>
                        <asp:ListItem>18</asp:ListItem>
                        <asp:ListItem>19</asp:ListItem>
                        <asp:ListItem>20</asp:ListItem>
                        <asp:ListItem>21</asp:ListItem>
                        <asp:ListItem>22</asp:ListItem>
                        <asp:ListItem>23</asp:ListItem>
                        <asp:ListItem>24</asp:ListItem>
                        <asp:ListItem>25</asp:ListItem>
                        <asp:ListItem>26</asp:ListItem>
                        <asp:ListItem>27</asp:ListItem>
                        <asp:ListItem>28</asp:ListItem>
                        <asp:ListItem>29</asp:ListItem>
                        <asp:ListItem>30</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:Label ID="lblTacGia" runat="server" Text="Tác giả"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtTacGia" runat="server" Width="177px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="auto-style5">
                    <asp:Label ID="lblNhaXuatBan" runat="server" Text="Nhà xuất bản"></asp:Label>
                </td>
                <td class="auto-style4">
                    <asp:TextBox ID="txtNhaXuatBan" runat="server" Height="16px" Width="177px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:Label ID="lblMoTa" runat="server" Text="Mô tả"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtMoTa" runat="server" Height="184px" TextMode="MultiLine" Width="470px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:Label ID="lblTrangThai" runat="server" Text="Trạng thái" Visible="False"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="ddlTrangThai" runat="server" Visible="False">
                        <asp:ListItem>Đang bán</asp:ListItem>
                        <asp:ListItem>Ngưng bán</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style6">&nbsp;</td>
                <td>
                    <asp:ImageButton ID="btnOK" runat="server" CommandArgument='<%# Eval("MaSach") %>' CommandName="Update" Height="38px" ImageUrl="../Images/Admin/ok.ico" OnClick="btnOK_Click" Text="OK" ToolTip="OK" Width="37px" />
                    <asp:ImageButton ID="btnOKSua" runat="server" CommandArgument='<%# Eval("MaSach") %>' CommandName="Update" Height="38px" ImageUrl="../Images/Admin/ok.ico" OnClick="btnOKSua_Click" Text="OK" ToolTip="OK" Visible="False" Width="37px" />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:ImageButton ID="btnCancel" runat="server" Height="38px" ImageUrl="~/Images/Admin/cancel.ico" OnClick="btnCancel_Click" Text="Cancel" ToolTip="Hủy" Width="37px" />
                </td>
            </tr>
            <tr>
                <td class="auto-style6">&nbsp;</td>
                <td>
                    <asp:Label ID="lblThongBao" runat="server" Font-Size="Large" ForeColor="#3366FF" Visible="False"></asp:Label>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <table class="auto-style1">
        <tr>
            <td>
                Điều kiện lọc:
                <asp:Label ID="Label1" runat="server" Text="Thể loại"></asp:Label>
                &nbsp;
                        <asp:DropDownList ID="ddlLoaiSach" runat="server">
                        </asp:DropDownList>
            &nbsp;&nbsp;Trạng thái&nbsp;
                <asp:DropDownList ID="ddlHienThiSach" runat="server">
                    <asp:ListItem>Sách còn đang bán</asp:ListItem>
                    <asp:ListItem>Sách hết hàng</asp:ListItem>
                    <asp:ListItem>Sách đã ngừng bán</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;
                Từ khóa&nbsp;
                        <asp:TextBox ID="txtTimKiem" runat="server"></asp:TextBox>
                <asp:ImageButton ID="btnTimKiem" runat="server" Text="Tìm kiếm" OnClick="btnTimKiem_Click" ImageUrl="../Images/Admin/search.ico" Height="19px" Width="25px" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<asp:ImageButton ID="btnThemSach" runat="server" CommandName="ThemSach" Text="Thêm" Width="37px" Height="38px" ImageUrl="../Images/Admin/addbook.ico" ToolTip="Thêm" OnClick="btnThemSach_Click" />
                &nbsp;&nbsp;&nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gdvSach" runat="server" CellPadding="3" AutoGenerateColumns="False" Width="100%" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" ShowFooter="True" OnRowCommand="gdvSach_RowCommand" AllowPaging="True" PageSize="5" ShowHeaderWhenEmpty="True" AllowSorting="True" OnPageIndexChanging="gdvSach_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField HeaderText="Hình">
                            <EditItemTemplate>
                                <asp:FileUpload ID="fuSuaHinh" runat="server" FileName='<%# Eval("Hinh") %>' Width="89px" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Image ID="imgHinh" runat="server" ImageUrl='<%# "../Images/Sach/"+Eval("Hinh") %>' Height="103px" Width="88px" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tựa sách">

                            <EditItemTemplate>
                                <asp:TextBox ID="txtSuaTenSach"  runat="server" Width="107px" Text='<%# Eval("Tensach") %>' Height="43px" TextMode="MultiLine"></asp:TextBox>
                            </EditItemTemplate>

                            <FooterTemplate>
                                <br />
                            </FooterTemplate>

                            <ItemTemplate>
                                <asp:Label ID="TextBox1" runat="server" Text='<%# Eval("Tensach") %>'></asp:Label>
                            </ItemTemplate>

                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Loại">
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlSuaLoai" runat="server" DataSource='<%#(List<Loai>)Session["Loaisach"]%>' DataTextField="TenLoai" DataValueField="MaLoai">
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblLoai" runat="server" Text='<%# Eval("Loai.TenLoai") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Giá tiền">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtSuaGiaTien" runat="server" Width="78px" Text='<%# Eval("GiaTien") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Eval("GiaTien") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số lượng">
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlSuaSoLuong" runat="server">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem>7</asp:ListItem>
                                    <asp:ListItem>8</asp:ListItem>
                                    <asp:ListItem>9</asp:ListItem>
                                    <asp:ListItem>10</asp:ListItem>
                                    <asp:ListItem>11</asp:ListItem>
                                    <asp:ListItem>12</asp:ListItem>
                                    <asp:ListItem>13</asp:ListItem>
                                    <asp:ListItem>14</asp:ListItem>
                                    <asp:ListItem>15</asp:ListItem>
                                    <asp:ListItem>16</asp:ListItem>
                                    <asp:ListItem>17</asp:ListItem>
                                    <asp:ListItem>18</asp:ListItem>
                                    <asp:ListItem>19</asp:ListItem>
                                    <asp:ListItem>20</asp:ListItem>
                                    <asp:ListItem>21</asp:ListItem>
                                    <asp:ListItem>22</asp:ListItem>
                                    <asp:ListItem>23</asp:ListItem>
                                    <asp:ListItem>24</asp:ListItem>
                                    <asp:ListItem>25</asp:ListItem>
                                    <asp:ListItem>26</asp:ListItem>
                                    <asp:ListItem>27</asp:ListItem>
                                    <asp:ListItem>28</asp:ListItem>
                                    <asp:ListItem>29</asp:ListItem>
                                    <asp:ListItem Value="30"></asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblSoLuong" runat="server" Text='<%# Eval("SoLuong") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tác giả">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtSuaTacGia" runat="server" Width="100px" Text='<%# Eval("TacGia") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label6" runat="server" Text='<%# Eval("TacGia") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Nhà xuất bản">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtSuaNhaXuatBan" runat="server" Text='<%# Eval("NhaXuatBan") %>' Height="17px" Width="91px"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblNhaXuatBan" runat="server" Text='<%# Eval("NhaXuatBan") %>' Width="80px"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Mô tả">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtSuaMoTa" runat="server" Width="194px" Text='<%# Eval("MoTa") %>' TextMode="MultiLine" Height="87px"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="Label7" runat="server" Text='<%# Eval("MoTa") %>' TextMode="MultiLine" Height="103px" Width="189px"></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Trạng thái">
                            <ItemTemplate>
                                <asp:CheckBox ID="cbxTrangThai" runat="server" Checked='<%# Eval("TrangThai") %>' Enabled="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <EditItemTemplate>
                                &nbsp;
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="btnSuaSach" runat="server" CommandName="suasach" Text="Sửa" Width="37px" ImageUrl="../Images/Admin/editbook.ico" Height="38px" ToolTip="Sửa" CommandArgument='<%# Eval("masach") %>'/>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        Không có sách nào được tìm thấy

                    </EmptyDataTemplate>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>

                &nbsp;</td>
        </tr>
    </table>
</div>
